set the loc of sprite sNumber to point(hInit, vInit)
set the member of sprite sNumber to member("still", sCast)
set the loc of sprite sNumberShad to the loc of sprite sNumber + point(hShad, vShad)
set the member of sprite sNumberShad to member("stillShad", sCast)
set the keyDownScript to "checkKeys hero"
end
on checkKeys me
global gameControl
case the keyCode of
5:
if the optionDown then
gameControl.action = "levelDone"
endLevel(me)
end if
0, 126:
Up(me)
6, 125:
down(me)
43, 123:
if action = "right" then
stand(me)
else
left(me)
end if
47, 124:
if action = "left" then
stand(me)
else
right(me)
end if
49:
stand(me)
end case
end
on move me
global gameControl
case action of
"left", "right", "up", "down":
set the loc of sprite sNumber to the loc of sprite sNumber + point(hIncr, vIncr)
set the loc of sprite sNumberShad to the loc of sprite sNumber + point(hShad, vShad)
if (the locH of sprite sNumber <= getAt(limits, 1)) or (the locH of sprite sNumber >= getAt(limits, 3)) or (the locV of sprite sNumber <= getAt(limits, 2)) or (the locV of sprite sNumber >= getAt(limits, 4)) then
set the loc of sprite sNumber to the loc of sprite sNumber - point(hIncr, vIncr)
set the loc of sprite sNumberShad to the loc of sprite sNumber + point(hShad, vShad)
stand(me)
updateStage()
end if
end case
end
on moveToFinished me
global gameControl
if abs(209 - the locH of sprite sNumber) > 6 then
if (209 - the locH of sprite sNumber) > 0 then
hIncr = 4
else
hIncr = -4
end if
else
set the locH of sprite sNumber to 209
hIncr = 0
end if
if abs(90 - the locV of sprite sNumber) > 6 then
if (90 - the locV of sprite sNumber) > 0 then
vIncr = 4
else
vIncr = -4
end if
else
set the locV of sprite sNumber to 90
vIncr = 0
end if
set the loc of sprite sNumber to the loc of sprite sNumber + point(hIncr, vIncr)
if sqrt(((90 - the locV of sprite sNumber) * (90 - the locV of sprite sNumber)) + ((209 - the locH of sprite sNumber) * (209 - the locH of sprite sNumber))) <= 10 then
gameControl.action = "finished"
end if
end
on stand me
set the loc of sprite sNumber to the loc of sprite sNumber - point(hOff, vOff)
hOff = 0
vOff = 0
hIncr = 0
vIncr = 0
animCel = 1
action = "stand"
set the member of sprite sNumber to member("still", sCast)
set the member of sprite sNumberShad to member("stillShad", sCast)
end
on Up me
hOff = 0
vOff = 0
hIncr = 0
vIncr = -maxIncr
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
action = "up"
set the member of sprite sNumber to member("up", sCast)
set the member of sprite sNumberShad to member("stillShad", sCast)
end
on down me
hOff = 0
vOff = 0
hIncr = 0
vIncr = maxIncr
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
action = "down"
set the member of sprite sNumber to member("down", sCast)
set the member of sprite sNumberShad to member("stillShad", sCast)
end
on left me
hOff = 0
vOff = 0
hIncr = -maxIncr
vIncr = 0
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
action = "left"
set the member of sprite sNumber to member("left", sCast)
set the member of sprite sNumberShad to member("leftShad", sCast)
end
on right me
hOff = 0
vOff = 0
hIncr = maxIncr
vIncr = 0
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
action = "right"
set the member of sprite sNumber to member("right", sCast)
set the member of sprite sNumberShad to member("rightShad", sCast)
end
on die me
global gameControl
hOff = 0 - hOff
vOff = 0 - vOff
hIncr = 0
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
puppetSound(2, "pow")
puppetSound(1, "sigh")
action = "dead"
gameControl.action = "dead"
set the member of sprite sNumber to member("die", sCast)
set the loc of sprite sNumberShad to point(-200, -200)
set the keyDownScript to EMPTY
end
on endLevel me
global gameControl
hOff = 0 - hOff
vOff = 0 - vOff
hIncr = 0
animCel = 1
set the loc of sprite sNumber to the loc of sprite sNumber + point(hOff, vOff)
action = "endLevel"
set the member of sprite sNumber to member("endLevel", sCast)
set the loc of sprite sNumberShad to point(-200, -200)